<?php

namespace Biz\Models\Site;

use Biz\Models\Model;
use Biz\Models\User\User;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * SiteOrder.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class SiteOrder extends Model
{
    use SoftDeletes;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'site_order';

    /**
     * @var array
     */
    protected $fillable = [
        'site_id',
        'type',
        'user_id',
        'order_no',
        'currency',
        'total_amount',
        'status',
    ];

    /**
     * Relationship for RegistrationFee.
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }

    /**
     * Relationship for RegistrationFee.
     */
    public function registration_fee()
    {
        return $this->hasOne(SiteOrderRegistrationFee::class, 'order_id', 'id');
    }

    /**
     * Relationship for HotelReservation.
     */
    public function hotel_reservation()
    {
        return $this->hasOne(SiteOrderHotelReservation::class, 'order_id', 'id');
    }
}
